//===============================================================================
// Microsoft patterns & practices
// Guidance Explorer Offline Client
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================



using System;
using GuidanceExplorer.Controls;
using GuidanceExplorer.Model;

namespace GuidanceExplorer.Views
{
    /// <summary>
    /// EventArgs used to send a GuidanceItem across component events.
    /// </summary>
    public class GuidanceItemFileReferenceEventArgs : EventArgs
    {
        /// <summary>
        /// The GuidanceItem that will be notified.
        /// </summary>
        private GuidanceItemFileReference[] _guidanceItemFileReference;

        /// <summary>
        /// The default mode for opening the guidance item reference;
        /// </summary>
        private ReadProtection _readProtection;

        /// <summary>
        /// The view to add the new item
        /// </summary>
        private ViewNode _view;

        private ChecklistNode _checklist;

        /// <summary>
        /// Default constructor with the GuidanceItem instance.
        /// </summary>
        /// <param name="guidanceItem">The GuidanceItem instance.</param>
        public GuidanceItemFileReferenceEventArgs(GuidanceItemFileReference[] guidanceItem, ReadProtection readProtection)
        {
            _guidanceItemFileReference = guidanceItem;
            _readProtection = readProtection;
        }

        /// <summary>
        /// Default constructor with the GuidanceItem instance.
        /// </summary>
        /// <param name="guidanceItem"></param>
        /// <param name="readProtection"></param>
        /// <param name="view"></param>
        public GuidanceItemFileReferenceEventArgs(GuidanceItemFileReference[] guidanceItem, ReadProtection readProtection, ViewNode view)
            : this(guidanceItem, readProtection)
        {
            _view = view;
        }

        public GuidanceItemFileReferenceEventArgs(GuidanceItemFileReference[] guidanceItem, ReadProtection readProtection,ViewNode view, ChecklistNode checklist)
            : this(guidanceItem, readProtection)
        {
            _view = view;
            _checklist = checklist;
        }

        /// <summary>
        /// The GuidanceItem instance.
        /// </summary>
        public GuidanceItemFileReference[] GuidanceItemFileReferences
        {
            get { return _guidanceItemFileReference; }
        }

        /// <summary>
        /// The default mode for opening the guidance item reference;
        /// </summary>
        public ReadProtection ReadProtection
        {
            get { return _readProtection; }
        }

        /// <summary>
        /// The view node to add the new item
        /// </summary>
        public ViewNode View
        {
            get { return _view; }
        }

        /// <summary>
        /// The Checklist node that contains the item if any
        /// </summary>
        public ChecklistNode CheklistParent
        {
            get { return _checklist; }
        }
    }
}

